Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __SPEECHRECOGNITION__
#define __SPEECHRECOGNITION__
#ifndef __MEMORY__
#include <Memory.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=mac68k
#endif
enum {
gestaltSpeechRecognitionVersion = 'srtb',
gestaltSpeechRecognitionAttr = 'srta'
};
enum {
gestaltDesktopSpeechRecognition = 1L << 0,
gestaltTelephoneSpeechRecognition = 1L << 1
};
/* Error Codes [Speech recognition gets -5100 through -5199] */
enum {
kSRNotAvailable = -5100, /* the service requested is not avail or applicable */
kSRInternalError = -5101, /* a system internal or hardware error condition */
kSRComponentNotFound = -5102, /* a needed system resource was not located */
kSROutOfMemory = -5103, /* an out of memory error occurred in the toolbox memory space */
kSRNotASpeechObject = -5104, /* the object specified is no longer or never was valid */
kSRBadParameter = -5105, /* an invalid parameter was specified */
kSRParamOutOfRange = -5106, /* when we say 0-100, don't pass in 101. */
kSRBadSelector = -5107, /* an unrecognized selector was specified */
kSRBufferTooSmall = -5108, /* returned from attribute access functions */
kSRNotARecSystem = -5109, /* the object used was not a SRRecognitionSystem */
kSRFeedbackNotAvail = -5110, /* there is no feedback window associated with SRRecognizer */
kSRCantSetProperty = -5111, /* a non-settable property was specified */
kSRCantGetProperty = -5112, /* a non-gettable property was specified */
kSRCantSetDuringRecognition = -5113, /* the property can't be set while recognition is in progress -- do before or between utterances. */
kSRAlreadyListening = -5114, /* in response to SRStartListening */
kSRNotListeningState = -5115, /* in response to SRStopListening */
kSRModelMismatch = -5116, /* no acoustical models are avail to match request */
kSRNoClientLanguageModel = -5117, /* trying to access a non-specified SRLanguageModel */
kSRNoPendingUtterances = -5118, /* nothing to continue search on */
kSRRecognitionCanceled = -5119, /* an abort error occurred during search */
kSRRecognitionDone = -5120, /* search has finished, but nothing was recognized */
kSROtherRecAlreadyModal = -5121, /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
kSRHasNoSubItems = -5122, /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
kSRSubItemNotFound = -5123, /* returned when accessing a non-existent sub item of a container */
kSRLanguageModelTooBig = -5124, /* Cant build language models so big */
kSRAlreadyReleased = -5125, /* this object has already been released before */
kSRAlreadyFinished = -5126, /* the language model can't be finished twice */
kSRWordNotFound = -5127, /* the spelling couldn't be found in lookup(s) */
kSRNotFinishedWithRejection = -5128, /* property not found because the LMObj is not finished with rejection */
kSRExpansionTooDeep = -5129, /* Language model is left recursive or is embedded too many levels */
kSRTooManyElements = -5130, /* Too many elements added to phrase or path or other langauge model object */
kSRCantAdd = -5131, /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject) */
kSRSndInSourceDisconnected = -5132, /* Sound input source is disconnected */
kSRCantReadLanguageObject = -5133, /* An error while trying to create new Language object from file or pointer -- possibly bad format */
/* non-release debugging error codes are included here */
kSRNotImplementedYet = -5199 /* you'd better wait for this feature in a future release */
kSRNotifyRecognitionBeginning = 1L << 0, /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
kSRNotifyRecognitionDone = 1L << 1 /* recognition has terminated. result (if any) is available. */
};
/* Apple Event selectors */
/* AppleEvent message class */
enum {
kAESpeechSuite = 'sprc'
};
/* AppleEvent message event ids */
enum {
kAESpeechDone = 'srsd',
kAESpeechDetected = 'srbd'
};
/* AppleEvent Parameter ids */
enum {
keySRRecognizer = 'krec',
keySRSpeechResult = 'kspr',
keySRSpeechStatus = 'ksst'
};
/* AppleEvent Parameter types */
enum {
typeSRRecognizer = 'trec',
typeSRSpeechResult = 'tspr'
};
/* SRRecognizer Properties */
enum {
kSRNotificationParam = 'noti', /* see notification flags below */
kSRCallBackParam = 'call', /* type SRCallBackParam */
kSRSearchStatusParam = 'stat', /* see status flags below */
kSRAutoFinishingParam = 'afin', /* automatic finishing applied on LM for search */
kSRForegroundOnly = 'fgon', /* Boolean. Default is true. If true, client recognizer only active when in foreground. */
kSRBlockBackground = 'blbg', /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive. */
kSRBlockModally = 'blmd', /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
kSRWantsResultTextDrawn = 'txfb', /* Boolean. Default is true. If true, search results are posted to Feedback window */
kSRWantsAutoFBGestures = 'dfbr', /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
kSRSoundInVolume = 'volu', /* short in [0..100] log scaled sound input power. Can't set this property */
kSRReadAudioFSSpec = 'aurd', /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
kSRCancelOnSoundOut = 'caso', /* Boolean: Default is true. If any sound is played out during utterance, recognition is aborted. */
kSRSpeedVsAccuracyParam = 'sped' /* SRSpeedSetting between 0 and 100 */
};
/* 0 means more accurate but slower. */
/* 100 means (much) less accurate but faster. */
enum {
kSRUseToggleListen = 0, /* listen key modes */
kSRUsePushToTalk = 1
};
enum {
kSRListenKeyMode = 'lkmd', /* short: either kSRUseToggleListen or kSRUsePushToTalk */
kSRListenKeyCombo = 'lkey', /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */